#include "llhttp_error_category.h"
#include <llhttp.h>

namespace wilson::http
{
    ::std::string llhttp_error_category::
    message(int code) const
    {
        return { ::llhttp_errno_name(static_cast<::llhttp_errno_t>(code)) };
    }
    
    ::std::error_condition llhttp_error_category::
    default_error_condition(int code) const noexcept
    {
        return { code, *this };
    }

    llhttp_error_category& llhttp_category()
    {
        static llhttp_error_category category;
        return category;
    }
}
